

var dns = require('dns');
dns.resolve('www.baidu.com', 'A', function(e, r){
	if(e)
		console.log(e);
	else
		console.log(r);
});
/*
[ '61.135.169.125', '61.135.169.121' ]
*/




dns.resolveMx('google.com', function(err, addresses){
	if(err)
		console.log(err);
	else
		console.log(addresses);
});

/*
[ { exchange: 'alt3.aspmx.l.google.com', priority: 40 },
  { exchange: 'alt4.aspmx.l.google.com', priority: 50 },
  { exchange: 'aspmx.l.google.com', priority: 10 },
  { exchange: 'alt1.aspmx.l.google.com', priority: 20 },
  { exchange: 'alt2.aspmx.l.google.com', priority: 30 } ]
*/